
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Model基类 · Diboot基础框架</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-vuejs-2/vue.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Service基类.html" />
    
    
    <link rel="prev" href="../CRUD通用封装.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                



<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../开始使用.html">
            
                <a href="../开始使用.html">
            
                    
                    开始使用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../开始使用/搭建环境.html">
            
                <a href="../开始使用/搭建环境.html">
            
                    
                    搭建环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../开始使用/使用framework.html">
            
                <a href="../开始使用/使用framework.html">
            
                    
                    使用diboot-framework
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../CRUD通用封装.html">
            
                <a href="../CRUD通用封装.html">
            
                    
                    CRUD通用封装
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.1" data-path="Model基类.html">
            
                <a href="Model基类.html">
            
                    
                    Model基类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="Service基类.html">
            
                <a href="Service基类.html">
            
                    
                    Service基类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="Mapper基类与SQL.html">
            
                <a href="Mapper基类与SQL.html">
            
                    
                    Mapper基类与SQL
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../MVC通用封装.html">
            
                <a href="../MVC通用封装.html">
            
                    
                    MVC通用封装
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../MVC通用封装/Controller基类.html">
            
                <a href="../MVC通用封装/Controller基类.html">
            
                    
                    Controller基类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../MVC通用封装/CrudController基类.html">
            
                <a href="../MVC通用封装/CrudController基类.html">
            
                    
                    CrudController基类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../MVC通用封装/CrudRestController基类.html">
            
                <a href="../MVC通用封装/CrudRestController基类.html">
            
                    
                    CrudRestController基类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../认证与安全.html">
            
                <a href="../认证与安全.html">
            
                    
                    认证与安全
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../认证与安全/jwt授权.html">
            
                <a href="../认证与安全/jwt授权.html">
            
                    
                    JWT认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../认证与安全/CSRF防护.html">
            
                <a href="../认证与安全/CSRF防护.html">
            
                    
                    CSRF防护
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../认证与安全/XSS防护.html">
            
                <a href="../认证与安全/XSS防护.html">
            
                    
                    XSS防护
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../系统参数配置.html">
            
                <a href="../系统参数配置.html">
            
                    
                    系统参数配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../系统参数配置/配置文件.html">
            
                <a href="../系统参数配置/配置文件.html">
            
                    
                    参数配置在文件中
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../系统参数配置/数据库表.html">
            
                <a href="../系统参数配置/数据库表.html">
            
                    
                    参数配置在数据库表中
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../系统日志记录.html">
            
                <a href="../系统日志记录.html">
            
                    
                    系统日志记录
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../系统日志记录/操作日志.html">
            
                <a href="../系统日志记录/操作日志.html">
            
                    
                    操作日志
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../系统日志记录/跟踪日志.html">
            
                <a href="../系统日志记录/跟踪日志.html">
            
                    
                    跟踪日志
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../常用工具类.html">
            
                <a href="../常用工具类.html">
            
                    
                    常用工具类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../常用工具类/D.html">
            
                <a href="../常用工具类/D.html">
            
                    
                    日期时间类D
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../常用工具类/S.html">
            
                <a href="../常用工具类/S.html">
            
                    
                    字符串类S
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../常用工具类/V.html">
            
                <a href="../常用工具类/V.html">
            
                    
                    数据校验类V
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../常用工具类/BeanUtils.html">
            
                <a href="../常用工具类/BeanUtils.html">
            
                    
                    Bean工具类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../常用工具类/JSON.html">
            
                <a href="../常用工具类/JSON.html">
            
                    
                    Json工具类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="../常用工具类/Encryptor.html">
            
                <a href="../常用工具类/Encryptor.html">
            
                    
                    加解密类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="../常用工具类/IdGenerator.html">
            
                <a href="../常用工具类/IdGenerator.html">
            
                    
                    ID生成器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="../常用工具类/Query.html">
            
                <a href="../常用工具类/Query.html">
            
                    
                    条件构造器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../通用基础模型.html">
            
                <a href="../通用基础模型.html">
            
                    
                    通用基础模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../通用基础模型/用户角色权限.html">
            
                <a href="../通用基础模型/用户角色权限.html">
            
                    
                    用户角色权限
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../通用基础模型/元数据.html">
            
                <a href="../通用基础模型/元数据.html">
            
                    
                    元数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../通用基础模型/文件.html">
            
                <a href="../通用基础模型/文件.html">
            
                    
                    文件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>



                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                

                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Model基类</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#model&#x57FA;&#x7C7B;"><b>1. </b>Model&#x57FA;&#x7C7B;</a></li><ul><li><span class="title-icon "></span><a href="#&#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;f"><b>1.1. </b>&#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;F</a></li></ul></ul></div><a href="#model&#x57FA;&#x7C7B;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="model&#x57FA;&#x7C7B;"><a name="model&#x57FA;&#x7C7B;" class="anchor-navigation-ex-anchor" href="#model&#x57FA;&#x7C7B;"><i class="fa fa-link" aria-hidden="true"></i></a>1. Model&#x57FA;&#x7C7B;</h1>
<blockquote>
<p>framework&#x9ED8;&#x8BA4;&#x63D0;&#x4F9B;BaseModel&#x548C;BaseTreeModel&#x4E24;&#x4E2A;&#x57FA;&#x7C7B;:</p>
</blockquote>
<ul>
<li><a href="">BaseModel</a>&#x4E2D;&#x9ED8;&#x8BA4;&#x63D0;&#x4F9B;: <ul>
<li>id(Long&#x578B;&#x4E3B;&#x952E;)</li>
<li>uuid(String&#x578B;&#x4E3B;&#x952E;)</li>
<li>createBy(&#x521B;&#x5EFA;&#x4EBA;ID)</li>
<li>createTime(&#x521B;&#x5EFA;&#x65F6;&#x95F4;)</li>
<li>updateTime(&#x66F4;&#x65B0;&#x65F6;&#x95F4;)</li>
<li>active(&#x903B;&#x8F91;&#x5220;&#x9664;&#x6807;&#x8BB0;)</li>
<li>extdata(&#x6269;&#x5C55;&#x5C5E;&#x6027;json)&#x3002;</li>
</ul>
</li>
<li><a href="">BaseTreeModel</a>&#x7EE7;&#x627F;&#x81EA;BaseModel&#xFF0C;&#x540C;&#x65F6;&#x6269;&#x5C55;&#x4E86;&#x4EE5;&#x4E0B;&#x5C5E;&#x6027;&#xFF0C;&#x7528;&#x4E8E;&#x652F;&#x6301;&#x6811;&#x5F62;&#x7ED3;&#x6784;model&#x3002;<ul>
<li>parentId(&#x4E0A;&#x7EA7;id)</li>
<li>children(&#x5B50;&#x8282;&#x70B9;&#x96C6;&#x5408;)&#x5C5E;&#x6027;</li>
</ul>
</li>
</ul>
<h2 id="&#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;f"><a name="&#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;f" class="anchor-navigation-ex-anchor" href="#&#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;f"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. &#x5C5E;&#x6027;&#x5B57;&#x6BB5;&#x5B9A;&#x4E49;&#x7C7B;F</h2>
<blockquote>
<p>&#x6BCF;&#x4E2A;Model&#x4E2D;&#x90FD;&#x4F1A;&#x6709;&#x4E00;&#x4E2A;&#x9759;&#x6001;&#x7684;F&#x7C7B;(Field)&#xFF0C;&#x7528;&#x4E8E;&#x5C5E;&#x6027;&#x540D;&#x7684;&#x552F;&#x4E00;&#x5B9A;&#x4E49;&#x5904;&#xFF0C;&#x4EFB;&#x4F55;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x5C5E;&#x6027;&#x540D;&#x7684;&#x5730;&#x65B9;&#xFF0C;&#x90FD;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5F15;&#x7528;F&#x7684;&#x5B9A;&#x4E49;&#xFF0C;&#x907F;&#x514D;&#x591A;&#x5904;&#x624B;&#x5199;&#x5B57;&#x7B26;&#x4E32;&#x51FA;&#x73B0;&#x4E0D;&#x4E00;&#x81F4;&#xFF0C;&#x540C;&#x65F6;&#x4E5F;&#x53EF;&#x501F;&#x52A9;IDE&#x7684;&#x63D0;&#x793A;&#x9AD8;&#x6548;&#x8F93;&#x5165;&#x3002;</p>
</blockquote>
<p>&#x793A;&#x4F8B;: </p>
<pre><code class="lang-java"><span class="hljs-comment">// &#x7528;&#x4E8E;&#x6784;&#x9020;&#x67E5;&#x8BE2;&#x6761;&#x4EF6;</span>
query.add(Metadata.F.itemName, <span class="hljs-string">&quot;&#x7537;&quot;</span>);

<span class="hljs-comment">// &#x7528;&#x4E8E;&#x6307;&#x5B9A;&#x66F4;&#x65B0;&#x5B57;&#x6BB5;</span>
messageService.updateModel(model, Message.F.status, Message.F.extdata);

<span class="hljs-comment">// &#x6307;&#x5B9A;&#x67E5;&#x8BE2;&#x5B57;&#x6BB5;</span>
metadataService.getKeyValuePairList(query.build(), Metadata.F.itemValue, Metadata.F.itemName);
</code></pre>
<p>&#x5982;&#x679C;&#x60A8;&#x542F;&#x7528;&#x4E86;diboot&#x5F00;&#x53D1;&#x52A9;&#x7406;&#xFF0C;Model&#x7684;&#x5C5E;&#x6027;&#x5B9A;&#x4E49;&#x548C;F&#x5B9A;&#x4E49;&#x53EF;&#x8DDF;&#x6570;&#x636E;&#x5E93;&#x8868;&#x540C;&#x6B65;&#x66F4;&#x65B0;&#xFF0C;&#x65E0;&#x9700;&#x624B;&#x5199;&#x3002;</p>
<p>&#x5982;&#x672A;&#x542F;&#x7528;&#x9700;&#x6CE8;&#x610F;&#x66F4;&#x65B0;&#x4FDD;&#x6301;F&#x7684;&#x5B9A;&#x4E49;&#x4E0E;Model&#x5C5E;&#x6027;&#x5B9A;&#x4E49;&#x4E00;&#x81F4;&#xFF08;Model&#x4E2D;&#x8DDF;&#x6570;&#x636E;&#x5E93;&#x8868;&#x5B57;&#x6BB5;&#x6620;&#x5C04;&#x65E0;&#x5173;&#x7684;&#x6269;&#x5C55;&#x5C5E;&#x6027;&#x65E0;&#x9700;&#x6DFB;&#x52A0;&#x5230;F&#xFF09;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                

            </div>

            
                
                <a href="../CRUD通用封装.html" class="navigation navigation-prev " aria-label="Previous page: CRUD通用封装">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Service基类.html" class="navigation navigation-next " aria-label="Next page: Service基类">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Model基类","level":"1.3.1","depth":2,"next":{"title":"Service基类","level":"1.3.2","depth":2,"path":"CRUD通用封装/Service基类.md","ref":"CRUD通用封装/Service基类.md","articles":[]},"previous":{"title":"CRUD通用封装","level":"1.3","depth":1,"path":"CRUD通用封装.md","ref":"CRUD通用封装.md","articles":[{"title":"Model基类","level":"1.3.1","depth":2,"path":"CRUD通用封装/Model基类.md","ref":"CRUD通用封装/Model基类.md","articles":[]},{"title":"Service基类","level":"1.3.2","depth":2,"path":"CRUD通用封装/Service基类.md","ref":"CRUD通用封装/Service基类.md","articles":[]},{"title":"Mapper基类与SQL","level":"1.3.3","depth":2,"path":"CRUD通用封装/Mapper基类与SQL.md","ref":"CRUD通用封装/Mapper基类与SQL.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["-sharing","sharing-plus","anchor-navigation-ex","theme-vuejs-2"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"search":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"theme-vuejs-2":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"mode":"float","pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"showLevel":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right","showGoTop":true,"isShowTocTitleIcon":true,"printLog":false,"multipleH1":true,"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false}},"sharing":{"qq":true,"all":["weibo","qq","linkedin","qzone","douban"],"douban":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"viber":false,"stumbleupon":false,"qzone":true,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Diboot基础框架","gitbook":"*","description":"Diboot基础框架"},"file":{"path":"CRUD通用封装/Model基类.md","mtime":"2018-11-08T08:51:40.454Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-10T15:08:25.671Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

